﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Text;
using System.Net;
using System.Net.Cache;
using Yd.Util;

namespace yedian
{
    public partial class OrderList : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public override void BindD()
        {
            try
            {
                this.rptlist.DataSource = GetPageSource(PageBtn, cbll.QueryView_yd_order);
                this.rptlist.DataBind();
            }
            catch (Exception e)
            {
                SaveSystemLog(e.Message);
            }
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            Dictionary<string, string> _d = new Dictionary<string, string>();
            if (this.userName.Text.Trim() != "")
                _d.Add("username", this.userName.Text.Trim());
            if (this.orderNo.Text.Trim() != "")
                _d.Add("orderno", this.orderNo.Text.Trim());
            if (this.shopName.Text.Trim() != "")
                _d.Add("shopname", this.shopName.Text.Trim());
            if (this.kzName.Text.Trim() != "")
                _d.Add("kzName", this.kzName.Text.Trim());
            if (this.date1.Text.Trim() != "")
                _d.Add("date1", this.date1.Text.Trim());
            if (this.date2.Text.Trim() != "")
                _d.Add("date2", this.date2.Text.Trim());
            if (orderstatus.Value.Trim() != "")
            {
                _d.Add("orderStatus", this.orderstatus.Value.Trim());
            }
            base.QueryGoToUrl("OrderList.aspx", _d);
        }
        //0 待处理  1已接单，2已拒接，3已使用
        public string sfrzs(string status)
        {
            if (status == "0")
            {
                return "待处理";
            }
            if (status == "1")
            {
                return "已接单";
            }
            if (status == "2")
            {
                return "已拒接";
            }
            if (status == "3")
            {
                return "已使用";
            }
            return "异常";
        }
    }
}